Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

function Get-RemoteAdministratorAccessDenied()
{
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null

    # get content web service
    $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    echo "RemoteAdministratorAccessDenied=" $contentService.RemoteAdministratorAccessDenied
}

Get-RemoteAdministratorAccessDenied

Write-Host " "
Write-Host "Completed.  Any key to exit..."
Read-Host
